import socket

# 1
s = socket.socket();
port = 12345
host = socket.gethostname();
# 2
print(host)
# 3
s.bind((host, port));
# 4
s.listen(5)
# 5
while True:
    c, addr = s.accept();
    print("连接地址===")
    print(addr)
    c.send(b" server data")
    rr = c.recv(1024);
    print("收到数据：")
    print(rr.decode())
    c.close()
